package net.adetech.crj.dao;


import net.adetech.crj.entity.Apply;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ApplyMapper {

    @Select("select * from CRJ_APPLY where APPLY_USER_ID = #{applyUserId} and DATA_STATE = '1'")
    List<Apply> getApplyListByApplyUserId(String applyUserId);

    @Insert("insert into crj_apply (apply_id, apply_user_id, id_type, id_number, real_name, apply_no ,apply_summary, apply_detail, apply_time, apply_state, data_state) " +
            "values(SEQ_CRJ_APPLY_APPLY_ID.NEXTVAL, #{applyUserId}, #{idType}, #{idNumber}, #{realName}, #{applyNo}, #{applySummary}, #{applyDetail}, sysdate, '1', '1') ")
    void saveApply(Apply apply);

}
